﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SdlDotNet.Core;
using SdlDotNet.Graphics;
using Point =  System.Drawing.Point;

namespace Pokemon
{
    class Game
    {
        [STAThread]
        static void Main()
        {
            Game Pokemon = new Game();
        }

        public Game()
        {
            Global.MainSurface = Video.SetVideoMode(480, 320);
            Video.WindowCaption = "Pokemon Oceanblue";
            Timer.Initialize();

            Global.Init();

            Events.TargetFps = 60000;
            Events.Quit += new EventHandler<QuitEventArgs>(this.Quit);
            Events.Tick += new EventHandler<TickEventArgs>(this.Update);
            Events.Run();
        }

        private void Update(object sender, TickEventArgs args)
        {
            /*foreach (Atom a in Global.Everything)
            {
                Global.MainSurface.Blit(a.Image, new Point(a.xPos, a.yPos));
            }*/
            Global.MainSurface.Blit(Global.Tileset[Global.Random.Next(16)], new Point(Global.Random.Next(30)*16, Global.Random.Next(20)*16));
            Global.MainSurface.Update();
        }

        private void Quit(object sender, QuitEventArgs e)
        {
            Events.QuitApplication();
        }
    }
}
